<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<title>lib/charsets.h</title>
<meta name='robots' content='noindex,nofollow' />
<meta name='generator' content='GLOBAL-6.5.7' />
<meta http-equiv='Content-Style-Type' content='text/css' />
<link rel='stylesheet' type='text/css' href='../style.css' />
</head>
<body>
<!-- beginning of fixed guide -->
<div id='guide'><ul>
<li><a href='#L79'><img class='icon' src='../icons/first.png' alt='[^]' /></a></li>
<li><a href='#L87'><img class='icon' src='../icons/last.png' alt='[v]' /></a></li>
<li><a href='#TOP'><img class='icon' src='../icons/top.png' alt='[top]' /></a></li>
<li><a href='#BOTTOM'><img class='icon' src='../icons/bottom.png' alt='[bottom]' /></a></li>
<li><a href='../mains.html'><img class='icon' src='../icons/index.png' alt='[index]' /></a></li>
<li><a href='../help.html'><img class='icon' src='../icons/help.png' alt='[help]' /></a></li>
<li class='standout'><span><a href='../files/lib.html'>lib</a>/charsets.h</span></li>
</ul></div>
<!-- end of fixed guide -->
<a id='TOP' name='TOP'></a><h2 class='header'><a href='../mains.html'>root</a>/<a href='../files/lib.html'>lib</a>/charsets.h</h2>
<em class='comment'>/* <img class='icon' src='../icons/n_left.png' alt='[previous]' /><img class='icon' src='../icons/n_right.png' alt='[next]' /><a href='#L79'><img class='icon' src='../icons/first.png' alt='[first]' /></a><a href='#L87'><img class='icon' src='../icons/last.png' alt='[last]' /></a><img class='icon' src='../icons/n_top.png' alt='[top]' /><a href='#BOTTOM'><img class='icon' src='../icons/bottom.png' alt='[bottom]' /></a><a href='../mains.html'><img class='icon' src='../icons/index.png' alt='[index]' /></a><a href='../help.html'><img class='icon' src='../icons/help.png' alt='[help]' /></a>&nbsp;<input type='text' readonly onfocus='this.select();' value='+1 lib/charsets.h'  /> */</em>
<hr />
<h2 class='header'><a href='../J/charsets.h.html' title='Multiple included from 35 places.'>INCLUDED FROM</a></h2>
<hr />
<h2 class='header'>DEFINITIONS</h2>
This source file includes following definitions.
<ol>
<li><a href='#L79' title='Defined at 79.'>convert_to_display_c</a></li>
<li><a href='#L87' title='Defined at 87.'>convert_from_input_c</a></li>
</ol>
<hr />
<pre>
<a id='L1' name='L1'></a>   1 <em class='comment'>/** \file charsets.h</em>
<a id='L2' name='L2'></a>   2 <em class='comment'> *  \brief Header: Text conversion from one charset to another</em>
<a id='L3' name='L3'></a>   3 <em class='comment'> */</em>
<a id='L4' name='L4'></a>   4 
<a id='L5' name='L5'></a>   5 <em class='sharp'>#ifndef</em> <a href='../S/lib--charsets.h.html#L6' title='Defined at 6 in lib/charsets.h.'>MC__CHARSETS_H</a>
<a id='L6' name='L6'></a>   6 <em class='sharp'>#define</em> <a href='../S/lib--charsets.h.html#L5' title='Referred from 5 in lib/charsets.h.'>MC__CHARSETS_H</a>
<a id='L7' name='L7'></a>   7 
<a id='L8' name='L8'></a>   8 <em class='comment'>/*** typedefs(not structures) and defined constants **********************************************/</em>
<a id='L9' name='L9'></a>   9 
<a id='L10' name='L10'></a>  10 <em class='comment'>/*** enums ***************************************************************************************/</em>
<a id='L11' name='L11'></a>  11 
<a id='L12' name='L12'></a>  12 <em class='comment'>/*** structures declarations (and typedefs of structures)*****************************************/</em>
<a id='L13' name='L13'></a>  13 
<a id='L14' name='L14'></a>  14 <strong class='reserved'>typedef</strong> <strong class='reserved'>struct</strong>
<a id='L15' name='L15'></a>  15 <em class='brace'>{</em>
<a id='L16' name='L16'></a>  16     <strong class='reserved'>char</strong> *<a href='../Y/id.html' title='Multiple used in 160 places.'>id</a>;
<a id='L17' name='L17'></a>  17     <strong class='reserved'>char</strong> *<a href='../Y/name.html' title='Multiple used in 736 places.'>name</a>;
<a id='L18' name='L18'></a>  18 <em class='brace'>}</em> <a href='../R/codepage_desc.html' title='Multiple referred from 15 places.'>codepage_desc</a>;
<a id='L19' name='L19'></a>  19 
<a id='L20' name='L20'></a>  20 <em class='comment'>/*** global variables defined in .c file *********************************************************/</em>
<a id='L21' name='L21'></a>  21 
<a id='L22' name='L22'></a>  22 <strong class='reserved'>extern</strong> <strong class='reserved'>unsigned</strong> <strong class='reserved'>char</strong> <a href='../Y/conv_displ.html' title='Multiple used in 7 places.'>conv_displ</a>[256];
<a id='L23' name='L23'></a>  23 <strong class='reserved'>extern</strong> <strong class='reserved'>unsigned</strong> <strong class='reserved'>char</strong> <a href='../Y/conv_input.html' title='Multiple used in 7 places.'>conv_input</a>[256];
<a id='L24' name='L24'></a>  24 
<a id='L25' name='L25'></a>  25 <strong class='reserved'>extern</strong> <strong class='reserved'>const</strong> <strong class='reserved'>char</strong> *<a href='../Y/cp_display.html' title='Multiple used in 21 places.'>cp_display</a>;
<a id='L26' name='L26'></a>  26 <strong class='reserved'>extern</strong> <strong class='reserved'>const</strong> <strong class='reserved'>char</strong> *<a href='../Y/cp_source.html' title='Multiple used in 25 places.'>cp_source</a>;
<a id='L27' name='L27'></a>  27 <strong class='reserved'>extern</strong> <a href='../Y/GPtrArray.html' title='Multiple used in 61 places.'>GPtrArray</a> *<a href='../Y/codepages.html' title='Multiple used in 29 places.'>codepages</a>;
<a id='L28' name='L28'></a>  28 
<a id='L29' name='L29'></a>  29 <em class='comment'>/*** declarations of public functions ************************************************************/</em>
<a id='L30' name='L30'></a>  30 
<a id='L31' name='L31'></a>  31 <strong class='reserved'>const</strong> <strong class='reserved'>char</strong> *<a href='../S/lib--charsets.c.html#L238' title='Defined at 238 in lib/charsets.c.'>get_codepage_id</a> (<strong class='reserved'>const</strong> <strong class='reserved'>int</strong> <a href='../Y/n.html' title='Multiple used in 370 places.'>n</a>);
<a id='L32' name='L32'></a>  32 <strong class='reserved'>int</strong> <a href='../S/lib--charsets.c.html#L246' title='Defined at 246 in lib/charsets.c.'>get_codepage_index</a> (<strong class='reserved'>const</strong> <strong class='reserved'>char</strong> *<a href='../Y/id.html' title='Multiple used in 160 places.'>id</a>);
<a id='L33' name='L33'></a>  33 <strong class='reserved'>void</strong> <a href='../S/lib--charsets.c.html#L200' title='Defined at 200 in lib/charsets.c.'>load_codepages_list</a> (<strong class='reserved'>void</strong>);
<a id='L34' name='L34'></a>  34 <strong class='reserved'>void</strong> <a href='../S/lib--charsets.c.html#L227' title='Defined at 227 in lib/charsets.c.'>free_codepages_list</a> (<strong class='reserved'>void</strong>);
<a id='L35' name='L35'></a>  35 <a href='../Y/gboolean.html' title='Multiple used in 1757 places.'>gboolean</a> <a href='../S/lib--charsets.c.html#L267' title='Defined at 267 in lib/charsets.c.'>is_supported_encoding</a> (<strong class='reserved'>const</strong> <strong class='reserved'>char</strong> *<a href='../Y/encoding.html' title='Multiple used in 56 places.'>encoding</a>);
<a id='L36' name='L36'></a>  36 <strong class='reserved'>char</strong> *<a href='../S/lib--charsets.c.html#L286' title='Defined at 286 in lib/charsets.c.'>init_translation_table</a> (<strong class='reserved'>int</strong> <a href='../Y/cpsource.html' title='Multiple used in 4 places.'>cpsource</a>, <strong class='reserved'>int</strong> <a href='../Y/cpdisplay.html' title='Multiple used in 4 places.'>cpdisplay</a>);
<a id='L37' name='L37'></a>  37 <strong class='reserved'>void</strong> <a href='../S/lib--charsets.c.html#L344' title='Defined at 344 in lib/charsets.c.'>convert_to_display</a> (<strong class='reserved'>char</strong> *<a href='../Y/str.html' title='Multiple used in 587 places.'>str</a>);
<a id='L38' name='L38'></a>  38 <strong class='reserved'>void</strong> <a href='../S/lib--charsets.c.html#L384' title='Defined at 384 in lib/charsets.c.'>convert_from_input</a> (<strong class='reserved'>char</strong> *<a href='../Y/str.html' title='Multiple used in 587 places.'>str</a>);
<a id='L39' name='L39'></a>  39 <strong class='reserved'>void</strong> convert_string (<strong class='reserved'>unsigned</strong> <strong class='reserved'>char</strong> *<a href='../Y/str.html' title='Multiple used in 587 places.'>str</a>);
<a id='L40' name='L40'></a>  40 
<a id='L41' name='L41'></a>  41 <em class='comment'>/*</em>
<a id='L42' name='L42'></a>  42 <em class='comment'> * Converter from utf to selected codepage</em>
<a id='L43' name='L43'></a>  43 <em class='comment'> * param str, utf char</em>
<a id='L44' name='L44'></a>  44 <em class='comment'> * return char in needle codepage (by global int mc_global.source_codepage)</em>
<a id='L45' name='L45'></a>  45 <em class='comment'> */</em>
<a id='L46' name='L46'></a>  46 <strong class='reserved'>unsigned</strong> <strong class='reserved'>char</strong> <a href='../S/lib--charsets.c.html#L424' title='Defined at 424 in lib/charsets.c.'>convert_from_utf_to_current</a> (<strong class='reserved'>const</strong> <strong class='reserved'>char</strong> *<a href='../Y/str.html' title='Multiple used in 587 places.'>str</a>);
<a id='L47' name='L47'></a>  47 
<a id='L48' name='L48'></a>  48 <em class='comment'>/*</em>
<a id='L49' name='L49'></a>  49 <em class='comment'> * Converter from utf to selected codepage</em>
<a id='L50' name='L50'></a>  50 <em class='comment'> * param input_char, gunichar</em>
<a id='L51' name='L51'></a>  51 <em class='comment'> * return char in needle codepage (by global int mc_global.source_codepage)</em>
<a id='L52' name='L52'></a>  52 <em class='comment'> */</em>
<a id='L53' name='L53'></a>  53 <strong class='reserved'>unsigned</strong> <strong class='reserved'>char</strong> <a href='../S/lib--charsets.c.html#L460' title='Defined at 460 in lib/charsets.c.'>convert_from_utf_to_current_c</a> (<strong class='reserved'>int</strong> <a href='../Y/input_char.html' title='Multiple used in 9 places.'>input_char</a>, <a href='../Y/GIConv.html' title='Multiple used in 59 places.'>GIConv</a> <a href='../Y/conv.html' title='Multiple used in 100 places.'>conv</a>);
<a id='L54' name='L54'></a>  54 
<a id='L55' name='L55'></a>  55 <em class='comment'>/*</em>
<a id='L56' name='L56'></a>  56 <em class='comment'> * Converter from selected codepage 8-bit</em>
<a id='L57' name='L57'></a>  57 <em class='comment'> * param char input_char, GIConv converter</em>
<a id='L58' name='L58'></a>  58 <em class='comment'> * return int utf char</em>
<a id='L59' name='L59'></a>  59 <em class='comment'> */</em>
<a id='L60' name='L60'></a>  60 <strong class='reserved'>int</strong> <a href='../S/lib--charsets.c.html#L492' title='Defined at 492 in lib/charsets.c.'>convert_from_8bit_to_utf_c</a> (<strong class='reserved'>char</strong> <a href='../Y/input_char.html' title='Multiple used in 9 places.'>input_char</a>, <a href='../Y/GIConv.html' title='Multiple used in 59 places.'>GIConv</a> <a href='../Y/conv.html' title='Multiple used in 100 places.'>conv</a>);
<a id='L61' name='L61'></a>  61 
<a id='L62' name='L62'></a>  62 <em class='comment'>/*</em>
<a id='L63' name='L63'></a>  63 <em class='comment'> * Converter from display codepage 8-bit to utf-8</em>
<a id='L64' name='L64'></a>  64 <em class='comment'> * param char input_char, GIConv converter</em>
<a id='L65' name='L65'></a>  65 <em class='comment'> * return int utf char</em>
<a id='L66' name='L66'></a>  66 <em class='comment'> */</em>
<a id='L67' name='L67'></a>  67 <strong class='reserved'>int</strong> <a href='../S/lib--charsets.c.html#L524' title='Defined at 524 in lib/charsets.c.'>convert_from_8bit_to_utf_c2</a> (<strong class='reserved'>char</strong> <a href='../Y/input_char.html' title='Multiple used in 9 places.'>input_char</a>);
<a id='L68' name='L68'></a>  68 
<a id='L69' name='L69'></a>  69 <a href='../Y/GString.html' title='Multiple used in 219 places.'>GString</a> *<a href='../S/lib--charsets.c.html#L394' title='Defined at 394 in lib/charsets.c.'>str_convert_to_input</a> (<strong class='reserved'>const</strong> <strong class='reserved'>char</strong> *<a href='../Y/str.html' title='Multiple used in 587 places.'>str</a>);
<a id='L70' name='L70'></a>  70 <a href='../Y/GString.html' title='Multiple used in 219 places.'>GString</a> *<a href='../S/lib--charsets.c.html#L402' title='Defined at 402 in lib/charsets.c.'>str_nconvert_to_input</a> (<strong class='reserved'>const</strong> <strong class='reserved'>char</strong> *<a href='../Y/str.html' title='Multiple used in 587 places.'>str</a>, <strong class='reserved'>int</strong> <a href='../Y/len.html' title='Multiple used in 1086 places.'>len</a>);
<a id='L71' name='L71'></a>  71 
<a id='L72' name='L72'></a>  72 <a href='../Y/GString.html' title='Multiple used in 219 places.'>GString</a> *<a href='../S/lib--charsets.c.html#L354' title='Defined at 354 in lib/charsets.c.'>str_convert_to_display</a> (<strong class='reserved'>const</strong> <strong class='reserved'>char</strong> *<a href='../Y/str.html' title='Multiple used in 587 places.'>str</a>);
<a id='L73' name='L73'></a>  73 <a href='../Y/GString.html' title='Multiple used in 219 places.'>GString</a> *<a href='../S/lib--charsets.c.html#L362' title='Defined at 362 in lib/charsets.c.'>str_nconvert_to_display</a> (<strong class='reserved'>const</strong> <strong class='reserved'>char</strong> *<a href='../Y/str.html' title='Multiple used in 587 places.'>str</a>, <strong class='reserved'>int</strong> <a href='../Y/len.html' title='Multiple used in 1086 places.'>len</a>);
<a id='L74' name='L74'></a>  74 
<a id='L75' name='L75'></a>  75 <em class='comment'>/*** inline functions ****************************************************************************/</em>
<a id='L76' name='L76'></a>  76 
<a id='L77' name='L77'></a>  77 <em class='comment'>/* Convert single characters */</em>
<a id='L78' name='L78'></a>  78 <strong class='reserved'>static</strong> <strong class='reserved'>inline</strong> <strong class='reserved'>int</strong>
<a id='L79' name='L79'></a>  79 <a href='../R/convert_to_display_c.html' title='Multiple referred from 6 places.'>convert_to_display_c</a> (<strong class='reserved'>int</strong> <a href='../Y/c.html' title='Multiple used in 1020 places.'>c</a>)
     <em class='comment'>/* <img class='icon' src='../icons/n_left.png' alt='[previous]' /><a href='#L87'><img class='icon' src='../icons/right.png' alt='[next]' /></a><img class='icon' src='../icons/n_first.png' alt='[first]' /><a href='#L87'><img class='icon' src='../icons/last.png' alt='[last]' /></a><a href='#TOP'><img class='icon' src='../icons/top.png' alt='[top]' /></a><a href='#BOTTOM'><img class='icon' src='../icons/bottom.png' alt='[bottom]' /></a><a href='../mains.html'><img class='icon' src='../icons/index.png' alt='[index]' /></a><a href='../help.html'><img class='icon' src='../icons/help.png' alt='[help]' /></a>&nbsp;<input type='text' readonly onfocus='this.select();' value='+79 lib/charsets.h'  /> */</em>
<a id='L80' name='L80'></a>  80 <em class='brace'>{</em>
<a id='L81' name='L81'></a>  81     <strong class='reserved'>if</strong> (<a href='../Y/c.html' title='Multiple used in 1020 places.'>c</a> &lt; 0 || <a href='../Y/c.html' title='Multiple used in 1020 places.'>c</a> &gt;= 256)
<a id='L82' name='L82'></a>  82         <strong class='reserved'>return</strong> <a href='../Y/c.html' title='Multiple used in 1020 places.'>c</a>;
<a id='L83' name='L83'></a>  83     <strong class='reserved'>return</strong> (<strong class='reserved'>int</strong>) <a href='../Y/conv_displ.html' title='Multiple used in 7 places.'>conv_displ</a>[<a href='../Y/c.html' title='Multiple used in 1020 places.'>c</a>];
<a id='L84' name='L84'></a>  84 <em class='brace'>}</em>
<a id='L85' name='L85'></a>  85 
<a id='L86' name='L86'></a>  86 <strong class='reserved'>static</strong> <strong class='reserved'>inline</strong> <strong class='reserved'>int</strong>
<a id='L87' name='L87'></a>  87 <a href='../R/convert_from_input_c.html' title='Multiple referred from 3 places.'>convert_from_input_c</a> (<strong class='reserved'>int</strong> <a href='../Y/c.html' title='Multiple used in 1020 places.'>c</a>)
     <em class='comment'>/* <a href='#L79'><img class='icon' src='../icons/left.png' alt='[previous]' /></a><img class='icon' src='../icons/n_right.png' alt='[next]' /><a href='#L79'><img class='icon' src='../icons/first.png' alt='[first]' /></a><img class='icon' src='../icons/n_last.png' alt='[last]' /><a href='#TOP'><img class='icon' src='../icons/top.png' alt='[top]' /></a><a href='#BOTTOM'><img class='icon' src='../icons/bottom.png' alt='[bottom]' /></a><a href='../mains.html'><img class='icon' src='../icons/index.png' alt='[index]' /></a><a href='../help.html'><img class='icon' src='../icons/help.png' alt='[help]' /></a>&nbsp;<input type='text' readonly onfocus='this.select();' value='+87 lib/charsets.h'  /> */</em>
<a id='L88' name='L88'></a>  88 <em class='brace'>{</em>
<a id='L89' name='L89'></a>  89     <strong class='reserved'>if</strong> (<a href='../Y/c.html' title='Multiple used in 1020 places.'>c</a> &lt; 0 || <a href='../Y/c.html' title='Multiple used in 1020 places.'>c</a> &gt;= 256)
<a id='L90' name='L90'></a>  90         <strong class='reserved'>return</strong> <a href='../Y/c.html' title='Multiple used in 1020 places.'>c</a>;
<a id='L91' name='L91'></a>  91     <strong class='reserved'>return</strong> (<strong class='reserved'>int</strong>) <a href='../Y/conv_input.html' title='Multiple used in 7 places.'>conv_input</a>[<a href='../Y/c.html' title='Multiple used in 1020 places.'>c</a>];
<a id='L92' name='L92'></a>  92 <em class='brace'>}</em>
<a id='L93' name='L93'></a>  93 
<a id='L94' name='L94'></a>  94 <em class='sharp'>#endif</em> <em class='comment'>/* MC__CHARSETS_H */</em>
</pre>
<hr />
<a id='BOTTOM' name='BOTTOM'></a>
<em class='comment'>/* <img class='icon' src='../icons/n_left.png' alt='[previous]' /><img class='icon' src='../icons/n_right.png' alt='[next]' /><a href='#L79'><img class='icon' src='../icons/first.png' alt='[first]' /></a><a href='#L87'><img class='icon' src='../icons/last.png' alt='[last]' /></a><a href='#TOP'><img class='icon' src='../icons/top.png' alt='[top]' /></a><img class='icon' src='../icons/n_bottom.png' alt='[bottom]' /><a href='../mains.html'><img class='icon' src='../icons/index.png' alt='[index]' /></a><a href='../help.html'><img class='icon' src='../icons/help.png' alt='[help]' /></a>&nbsp;<input type='text' readonly onfocus='this.select();' value='+94 lib/charsets.h'  /> */</em>
</body>
</html>
